<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../css/tc/tc1.css"/>
</head>
<script src="../../js/getParameter.js"></script>
<script src="../../js/jquery3.js"></script>
<script src="../../layui/layui.js"></script>
<script>
    $(function () {
        layui.use('layer', function () {
            var layer = layui.layer;
        let uid = getParameter("uid");

                $(".form").submit(function () {

                    $.ajaxSettings.async = false;
                    $.post("/product/addProduct?uid="+uid, $(this).serialize(), function (data) {
                        if (data == "success") {
                            layer.msg('添加成功',{icon:6,time:1000}, function(){
                                window.parent.location.reload(); //刷新父页面
                                var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                                parent.layer.close(index);
                            });
                        }
                    })

                    return false;
                })
        })
            })
</script>
<body>

<div class="cd-popup-container">
    <p></p>
    <div class="cd-buttons" style="margin-left: 40px;margin-top: 40px;">
        <form class="form">
            <div class="bd1">
                <div><span>产品名称：</span><br><input type="text" name="prName" id="prName" /></div>
                <div><span>存量：</span><br><input type="text" name="prNum" id="prNum" /></div>
                <div><span>产品描述：</span><br>
                    <textarea style="resize:none;width: 480px;height: 150px;" name="prDescribe"
                              id="prDescribe"></textarea>
                </div>

            </div>
            <div class="bd2">
                <div><span>产品状态：</span><br>
                    <select id="prStatus" name="prStatus" class="from">
                        <option value="已上架">已上架</option>
                        <option value="未上架">未上架</option>
                    </select></div>
                <div><span>单价(人民币)：</span><br><input type="text" name="prPrice" id="prPrice" /></div>

            </div>


            <input type="submit" value="提交" class="submit"/>
        </form>
    </div>
</div>

</body>
</html>
